extends ../layout

block content
	.container
		.row
			.col-md-7
				embed(src="#{movie.flash}", allowFullScreen="true", quality="high", width="720", height="600", aligh="middle", type="application/x-shockwave-flash")
				.panel.panel-default
					.panel-heading
						h3 评论区
					.panel-body
						ul.media-list
							each item in comments
								li.media
									.pull-left
										a.comment(href="#comments", data-cid="#{item._id}", data-tid="#{item.from._id}", data-tname="#{item.from.name}")
											img.media-object(src="http://tva2.sinaimg.cn/crop.0.0.1068.1068.180/005DkyGsjw8f7bbd3rgglj30to0tpq59.jpg", width="60", alt="用户头像")
									.media-body
										h4.media-heading #{item.from.name}
										p #{item.content}
										if item.reply && item.reply.length > 0
											each reply in item.reply
												.media
													.pull-left
														a.comment(href="#comments", data-cid="#{item._id}", data-tid="#{reply.from._id}", data-tname="#{reply.from.name}")
															img.media-object(src="http://tva2.sinaimg.cn/crop.0.0.1068.1068.180/005DkyGsjw8f7bbd3rgglj30to0tpq59.jpg", width="40", alt="用户头像")
													.media-body
														h4.media-heading
															|#{reply.from.name}
															span.text-info &nbsp;回复&nbsp;
															|#{reply.to.name}:
														p #{reply.content}
									hr
						#comments
							form#commentForm(method="POST", action="/user/comment")
								input(type="hidden" name="comment[movie]", value="#{movie._id}")
								if user._id!=""
									input#user-id(type="hidden" name="comment[from]", value="#{user._id}")
								.form-group
									textarea#relpy-area.form-control(name="comment[content]", row="3")
								if user._id!=""
									button.btn.btn-primary(type="submit") 提交
								else
									a.navbar-link(href="#", data-toggle="modal", data-target="#signinModal" class="btn btn-primary") 请登录后评论 
			.col-md-5
				dl.dl-horizontal
					dt 电影名
					dd= movie.title
					dt 导演
					dd= movie.doctor
					dt 国家
					dd= movie.country
					dt 语言
					dd= movie.language
					dt 上映年份
					dd= movie.year
					dt 简介
					dd= movie.summary
	script(src="/js/detail.js")